#ifndef COLLECTIONITEMMODEL_H
#define COLLECTIONITEMMODEL_H

#include <QAbstractItemModel>
#include <QModelIndex>
#include <QVariant>
#include "artist.h"
#include "album.h"
#include "song.h"
#include "collection.h"

class CollectionItemModel : public QAbstractItemModel
{
    Q_OBJECT
public:
    CollectionItemModel(Collection * collection);
    QModelIndex index(int row, int column, const QModelIndex & parent = QModelIndex()) const;
    QModelIndex parent(const QModelIndex & index ) const;
    int rowCount(const QModelIndex & parent = QModelIndex()) const;
    int columnCount(const QModelIndex & parent = QModelIndex()) const;
    QVariant data(const QModelIndex & index, int role = Qt::DisplayRole) const;

private:
    Collection * collection;
    int state;
    QList< Artist* > * artists;
    QList<Album* > * albums;
    QList<Song* > * songs;

signals:
    void songSelected(Song * song);
    void atRoot();

public slots:
    void clickedCallback(QModelIndex index);
    void previous();
};

#endif // COLLECTIONITEMMODEL_H
